package com.zmzncs.lmtc.module.customer.dao;

import com.zmzncs.lmtc.module.customer.pojo.ticket.CustTicket;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.zmzncs.lmtc.module.customer.pojo.ticket.CustTicketDTO;
import com.zmzncs.lmtc.module.promotion.pojo.ticket.TicketDTO;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author JD
 * @since 2020-10-09
 */
@Repository
public interface CustTicketDao extends BaseMapper<CustTicket> {

    /**根据优惠券id查询*/
    CustTicketDTO getById(Long id);

    /** 查询未使用-且当前可用的券  **/
    List<CustTicketDTO> getNotExpiredValidTicket(@Param("customerId")Long customerId, @Param("cardType")Integer cardType,@Param("shopId") Long shopId);

    /** 查询未使用   **/
    List<CustTicketDTO> getNotExpiredTicket(Long customerId);

    /** -查询-已使用**/
    List<CustTicketDTO> getUsedTicket(Long customerId);

    /** 查询客户领取的某个优惠券**/
    List<CustTicketDTO> getReservedTicket(@Param("customerId")Long customerId, @Param("ticketId")Long ticketId);

    /** 查询-已过期  **/
    List<CustTicketDTO> getExpireTicket(Long customerId);

    /** 查询-需要首页提醒的优惠券  **/
    List<CustTicketDTO> getTipsTicket(Long customerId);

    /**更新优惠券是否提示 */
    int updateTipsStatus(@Param("customerId") Long customerId);

}
